package com.sakura.convert.impl;/**
 * Created by apple on 2019/3/25.
 */

import com.sakura.convert.TypeConvert;
import org.springframework.stereotype.Component;

/**
 * @author jixd
 * @Description TODO
 * @Date 2019/3/25 4:05 PM
 * @Version 1.0
 **/
@Component
public class TypeConvertImpl implements TypeConvert {
    @Override
    public String databaseType2Java(String columnType) {
        switch (columnType.toLowerCase()){
            case "varchar":
            case "char":return "String";
            case "smallint":
            case "int":
            case "tinyint":return "Integer";
            case "bigint":return "Long";
            case "double":return "Double";
            case "float":return "Double";
            case "clob":return "java.sql.Clob";
            case "blob":return "java.sql.Blob";
            case "date":return "java.sql.Date";
            case "time":return "java.sql.Time";
            case "timestamp":return "java.sql.Timestamp";
            default:return null;
        }
    }

    @Override
    public String java2Database(String javaType) {
        return null;
    }
}
